Using `g_object_set_data` for passing user name.

Posted by PP on Stack Overflow See other posts from Stack Overflow or by PP
Published on 2010-05-04T11:20:45Z Indexed on 2010/05/04 13:18 UTC
Read the original article Hit count: 141

Filed under:
|

I am using g_object_set_data to set user name with event_box so in call back i can get it with in event_box pointer.

g_object_set_data(G_OBJECT(event_box), "user_name", (gpointer)(user_name) );

but problem is that i am setting user_name which is not an pointer allocated string.
It is an local string (not allocated on hip) which gets destroyed.

So is it necessary to allocated and then use the pointer, i just want to associate one name with this event_box.

© Stack Overflow or respective owner

Related posts about gtk

Related posts about gtk+